import { type App } from 'vue'
import 'virtual:svg-icons-register'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import SvgIcon from './src/svg-icon.vue'

/**
 * 安装图标
 */
const useIcon = {
  install(app: App) {
    for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
      app.component(key, component)
    }

    app.component('SvgIcon', SvgIcon)
  }
}

export default useIcon
